const http = (obj) => {
  return new Promise((resolve,reject) => {
    wx.request({
      url: 'http://localhost:3000/' + obj.url,
      method: obj.method || 'GET',
      data: obj.data || {},
      header: obj.header || {
        'content-type': 'application/json'
      },
      success: (res) => {
        resolve(res);
      },
      fail: (err) => {
        reject(err);
      }
    })
  })

}
export default http